package com.v1.model;

import java.util.Date;

import weibo4j.model.Status;

public class Diary extends BaseModel implements Comparable<Diary> {

	private String id;
	private String userDomain;
	private String screenName;
	private String profileImageUrl;
	private String avatarLarge;
	private String text;
	private Date createdAt;
	private String mid;

	public Diary(Status s) {
		text = s.getText();
		if (s.getUser() != null) {
			id = s.getUser().getId();
			userDomain = s.getUser().getUserDomain();
			screenName = s.getUser().getScreenName();
			profileImageUrl = s.getUser().getProfileImageUrl();
			avatarLarge = s.getUser().getAvatarLarge();
		}
		createdAt = s.getCreatedAt();
		mid = s.getMid();

	}

	@Override
	public int compareTo(Diary o) {
		return o.createdAt.compareTo(createdAt);
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getUserDomain() {
		return userDomain;
	}

	public void setUserDomain(String userDomain) {
		this.userDomain = userDomain;
	}

	public String getScreenName() {
		return screenName;
	}

	public void setScreenName(String screenName) {
		this.screenName = screenName;
	}

	public String getProfileImageUrl() {
		return profileImageUrl;
	}

	public void setProfileImageUrl(String profileImageUrl) {
		this.profileImageUrl = profileImageUrl;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public Date getCreatedAt() {
		return createdAt;
	}

	public void setCreatedAt(Date createdAt) {
		this.createdAt = createdAt;
	}

	public String getMid() {
		return mid;
	}

	public void setMid(String mid) {
		this.mid = mid;
	}

	public String getAvatarLarge() {
		return avatarLarge;
	}

	public void setAvatarLarge(String avatarLarge) {
		this.avatarLarge = avatarLarge;
	}
}
